package com.eatme.web.security.service.impl;

import com.eatme.web.security.authentication.dao.SecurityUserAuthDao;
import com.eatme.web.security.authentication.dao.SecurityUserDao;
import com.eatme.web.security.authentication.domain.entity.SecurityUser;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsPasswordService;
import org.springframework.stereotype.Service;

@Service
public class SecurityUserPasswordServiceImpl implements UserDetailsPasswordService {


    private final SecurityUserDao securityUserDao;

    public SecurityUserPasswordServiceImpl(SecurityUserDao securityUserDao) {
        this.securityUserDao = securityUserDao;
    }


    @Override
    public SecurityUser updatePassword(UserDetails userDetails, String newPassword) {
//        return securityUserDao.findByUsername(userDetails.getUsername()).map(user -> {
//            user.setPassword(newPassword);
//            User result = securityUserDao.save(user);
//            return result;
//        }).orElse((User) userDetails);
        return null;
    }
}
